package com.wang.users.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wang.users.mapper.AmenuMapper;
import com.wang.users.pojo.Amenu;
import com.wang.users.service.AmenuService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
* @author Zjx
* @description 针对表【a_menu(菜单表)】的数据库操作Service实现
* @createDate 2023-11-21 22:26:27
*/
@Service
public class AmenuServiceImpl extends ServiceImpl<AmenuMapper, Amenu>
    implements AmenuService {

    /**
    * 对父类超级不满意
    * 顶了一个编程式事务
    * @param entity 实体对象
    * @return
    */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean save(Amenu entity) {
    /* 一些用户不需要操作的字段,需要系统自动赋值的放到此处 */
    entity.setCreateTime(new Date());
    entity.setUpdateTime(new Date());

    boolean dbFlag = super.save(entity);
    //        log.info("==保存成功:{}==", dbFlag);
    //        String str = null;
    //        str.toString();
    return dbFlag;
    }
}




